<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
      //  页面加载完毕后执行
      window.onload = function (){
        var elementsImg = document.getElementsByTagName('img');
        elementsImg[0].src='./2.png'

        console.log(elementsImg[0].alt)
        elementsImg[0].alt = 'newDesktop'
        console.log(elementsImg[0].alt)
        console.log(elementsImg[0].number)
        elementsImg[0].number = 10
        console.log(elementsImg[0].number)
      }
  </script>
</head>
<body>

<!--
    节点对象属性操作
    src
    alt
    style  样式
-->

<img src="./1.png" alt="desktop">
<h1 id="info">hello</h1>

<script>

  var info = document.getElementById("info");
  info.style.color='red'
  info.style.fontSize = '50px'   // 内联样式

</script>
</body>
</html>